#ifndef SERVERVIEW_H
#define SERVERVIEW_H

#include <QWidget>
#include <QScreen>
#include <QTcpServer>
#include <QTcpSocket>
#include <QList>
#include <QTextBlock>
#include <QMessageBox>

#include "../../observer/viewsubject.h"

namespace Ui {
class ServerView;
}

class ServerView : public QWidget,public ViewSubject
{
    Q_OBJECT

public:
    explicit ServerView(QWidget *parent = nullptr);

    void init();

    ~ServerView();
public slots:
    void onNewConnection();
    void onSendBtnClicked();
    void onBindBtnClicked(); // 绑定端口

private:
    Ui::ServerView *ui;

    QSharedPointer<QTcpServer> m_server{nullptr};
    QList<QTcpSocket*> m_sockList;
};

#endif // SERVERVIEW_H
